package com.battle.service.controller.web;

import com.battle.pojo.entity.LabelMp;
import com.battle.pojo.param.label.CreateLabelParam;
import com.battle.pojo.param.label.EditLabelParam;
import com.battle.pojo.param.label.GetLabelDownListParam;
import com.battle.pojo.param.label.GetLabelListParam;
import com.battle.pojo.param.labelMp.CreateLabelMpParam;
import com.battle.pojo.param.labelMp.GetLabelMpDownListParam;
import com.battle.pojo.param.labelMp.GetLabelMpListParam;
import com.battle.pojo.vo.label.GetLabelDownListVo;
import com.battle.pojo.vo.label.GetLabelListVo;
import com.battle.pojo.vo.label.GetLabelVo;
import com.battle.pojo.vo.labelMp.GetLabelMpDownListVo;
import com.battle.service.service.in.LabelMpService;
import com.battle.service.service.in.LabelService;
import jakarta.validation.Valid;
import nirvana.core.domains.vo.ApiResult;
import nirvana.core.domains.vo.PageResult;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * web/标签Mp
 * 【描 述】：
 * 【环 境】：J2SE
 * 【详 细】：
 */
@RestController
@RequestMapping("/labelMp/web")
public class LabelMpController {

    private final LabelMpService service;

    public LabelMpController(LabelMpService service) {
        this.service = service;
    }


    /**
     * 战例标签
     *
     * @param param
     * @return
     */
    @PostMapping("/createLabelMp")
    public ApiResult createLabelMp(@RequestBody @Valid CreateLabelMpParam param) {
        service.createLabelMp(param.getIds(),param.getFid());
        return ApiResult.ok();
    }



    /**
     * 获取战例的关联标签
     *
     * @return
     */
    @PostMapping("/getLabelDownList")
    public ApiResult<List<GetLabelMpDownListVo>> getLabelDownList(@RequestBody(required = false) @Valid GetLabelMpDownListParam param) {
        List<GetLabelMpDownListVo> list = service.getLabelMpDownList(param);
        return ApiResult.ok(list);
    }

    /**
     * 智能机器人-获取对应标签下的战例
     *
     * @return
     */
    @PostMapping("/getLabelByName")
    public ApiResult<List<GetLabelMpDownListVo>> getLabelByName(@RequestBody(required = false) @Valid GetLabelMpListParam param) {
        List<GetLabelMpDownListVo> list = service.getLabelByName(param);
        return ApiResult.ok(list);
    }
}

